package com.wzy.alllearning.controller;

import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wzy.alllearning.domain.common.PageResult;
import com.wzy.alllearning.domain.common.ResponseResult;
import com.wzy.alllearning.domain.dto.UserDTO;
import com.wzy.alllearning.domain.dto.UserQuerytDTO;

import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping("/api/users")
@Slf4j
public class UserController
{
	@PostMapping
	public ResponseResult save(@RequestBody UserDTO userDTO)
	{
		return ResponseResult.success("新增成功");
	}

	@PutMapping("/{id}")
	public ResponseResult update(@PathVariable("id") Long id, @RequestBody UserDTO userDTO)
	{
		return ResponseResult.success("更新成功！");
	}

	@DeleteMapping("/{id}")
	public ResponseResult delete(@PathVariable("id") Long id)
	{
		return ResponseResult.success("删除成功！");
	}

	@GetMapping("{id}")
	public ResponseResult query(@PathVariable("id") Long id)
	{
		return ResponseResult.success("查找成功！");
	}

	@GetMapping()
	public ResponseResult<PageResult> query(Integer pageNo, Integer pageSize, UserQuerytDTO querytDTO)
	{
		return ResponseResult.success(new PageResult());
	}

}
